<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Flex布局</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .box {
      margin: 30px 50px;
      width: 500px;
      height: 400px;
      background-color: red;
      /* 开启flex布局 */
      /* 
        内部的子盒子就变成行内-块级标签
      */
      display: flex;
      /* 设置主轴的方向 row(横着) column(竖着) */
      flex-direction: row;
      /* 设置主轴换行 */
      /* nowrap/wrap/wrap-reverse */
      flex-wrap: wrap;
    }

    .box1 {
      background-color: green;
      width: 100px;
      height: 100px;
    }

    .box2 {
      background-color: blue;
      width: 100px;
      height: 100px;
    }

    .box3 {
      background-color: skyblue;
      width: 100px;
      height: 100px;
    }

    .box4 {
      background-color: pink;
      width: 300px;
      height: 100px;
    }

    .box5 {
      background-color: orange;
      width: 300px;
      height: 100px;
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="box1">盒子11111</div>
    <div class="box2">盒子2</div>
    <div class="box3">盒子3</div>
    <div class="box4">盒子4</div>
    <div class="box5">盒子5</div>
  </div>
</body>

</html>